import { createRouter, createWebHistory } from 'vue-router'
import beforeEach from './BeforeEach'
import entry from '@/views/entry.vue'
import service from '@/views/service.vue'
import privacy from '@/views/privacy.vue'
import miaobi from '@/views/miaobi.vue'
import buySeedings from '@/views/buySeedings.vue'
import releaseSeeding from '@/views/releaseSeeding.vue'
import seedingsDetail from '@/views/seedingsDetail.vue'
import searchNursery from '@/views/search/searchNursery.vue'
import askToBuyList from '@/views/search/askToBuyList.vue'
import publishList from '@/views/search/publishList.vue'
import purchaseDetail from '@/views/purchaseDetail.vue'
import authEnterprise from '@/views/authentication/enterprise.vue'
import authPersonal from '@/views/authentication/personal.vue'
import mapPicker from '@/components/MapPicker.vue'
import myPurchase from '@/views/myPurchase.vue'
import feedback from '@/views/feedback.vue'
import vip from '@/views/vip.vue'
import informationDetail from '@/views/informationDetail.vue'
import invite from '@/views/invite.vue'
import vipRights from '@/views/vipRights.vue'
import businessDetail from '@/views/businessDetail.vue'

import test from '@/views/test.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/entry',
      name: 'entry',
      component: entry
    },
    {
      path: '/service',
      name: 'service',
      component: service
    },
    {
      path: '/privacy',
      name: 'privacy',
      component: privacy
    },
    {
      path: '/miaobi',
      name: 'miaobi',
      component: miaobi
    },
    // 求购
    {
      path: '/buySeedings',
      name: 'buySeedings',
      component: buySeedings
    },
    // 发布
    {
      path: '/releaseSeeding',
      name: 'releaseSeeding',
      component: releaseSeeding
    },
    // 苗木详情
    {
      path: '/seedingsDetail',
      name: 'seedingsDetail',
      component: seedingsDetail
    },
    // 搜索苗木
    {
      path: '/searchNursery',
      name: 'searchNursery',
      component: searchNursery
    },
    // 搜索苗木(发布)
    {
      path: '/askToBuyList',
      name: 'askToBuyList',
      component: askToBuyList
    },
    // 搜索苗木(求购)
    {
      path: '/publishList',
      name: 'publishList',
      component: publishList
    },
    // 我的求购列表
    {
      path: '/myPurchase',
      name: 'myPurchase',
      component: myPurchase
    },
    // 求购详情
    {
      path: '/purchaseDetail',
      name: 'purchaseDetail',
      component: purchaseDetail
    },
    // 个人认证
    {
      path: '/authPersonal',
      name: 'authPersonal',
      component: authPersonal
    },
    // 企业认证
    {
      path: '/authEnterprise',
      name: 'authEnterprise',
      component: authEnterprise
    },
    {
      path: '/mapPicker',
      name: 'mapPicker',
      component: mapPicker
    },
    {
      path: '/test',
      name: 'test',
      component: test
    },
    {
      path: '/feedback',
      name: 'feedback',
      component: feedback
    },
    {
      path: '/vip',
      name: 'vip',
      component: vip
    },
    {
      path: '/informationDetail',
      name: 'informationDetail',
      component: informationDetail
    },
    {
      path: '/invite',
      name: 'invite',
      component: invite
    },
    {
      path: '/vipRights',
      name: 'vipRights',
      component: vipRights
    },
    // 苗商详情
    {
      path: '/businessDetail',
      name: 'businessDetail',
      component: businessDetail
    }
  ]
})

router.beforeEach(beforeEach)

export default router
